package org.xilin

import org.xilin.Role

/**
 * User domain class.
 */
class User {
    static transients = ['pass']
    static hasMany = [authorities: Role]
    static belongsTo = Role
    /** Username */
    String username
    /** User Real Name*/
//    String userRealName

    /** MD5 Password */
    String passwd
    /** enabled */
    boolean enabled

    String email
    boolean emailShow

    /** description */
    String description = ''

    /** plain password to create a MD5 password */
    String pass = '[secret]'

    static constraints = {
            username(size:5..20, blank: false, unique: true)
    //	userRealName(blank: false)
            email(email:true,blank:false)
            passwd(blank: false)
            enabled()
    }

    String toString() {
        username
    }

}
